package dome;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-04-07
 * Time: 7:39
 */

public class Test {
/*    public int size(){
        ListNode cun = head;
        int count = 0;
        while (cun != null){
            count++;
            cun = cun.next;
        }
       return count;
    }*/

/*    public boolean contains(int key){
        ListNode cun = head;
        while (cun != null){
            if(cun.val == key){
                return true;
            }
            cun = cun.next;
        }
        return false;
    }*/
/*    public void addFirst(int data){
        ListNode node = new ListNode(data);
        node.next = head;
        head = node;
    }*/
/*    public void addLast(int data){
        ListNode node = new ListNode(data);
        ListNode cur = head;
        if(head == null){
            head = node;
            return;
        }
        while(cur.next != null){
            cur = cur.next;
        }
        cur.next = node;
    }*/
    public void addIndex(int dext,int key){
        ListNode node = new ListNode(key);
        List cur = head;
        int count = 0;
        while(cur != null){
            count++;
        }
        if(dext == 0){
            node.next = head;
            head = node;
        }
        if(dext == count){
            while(cur.next != null){
                cur = cur.next;
            }
            cur.next = node;
        }
        while(cur.next != null){
            if( != null)
            cur = cur.next;
        }
    }
    public static void main(String[] args) {

    }
}
